﻿<local:DocumentBase x:Class="WPFExcelReport.DSTREQYARN"
           xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
          xmlns:local="clr-namespace:ReflectionStudio.Components.UserControls;assembly=ReflectionStudio.Core"
                xmlns:fd="clr-namespace:Labs.Filtering;assembly=ReflectionStudio.Core"
        xmlns:wep="clr-namespace:WPFExcelReport"
        xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls"
       Height="700" Width="1024" 
       Background="White" 
         Loaded="Window_Loaded"
        Title="DSTREQYARN"  
     >
    <local:DocumentBase.Resources>
        <ucd:DD2ColorConverter  x:Key="dd2color"/>
    </local:DocumentBase.Resources>
    <Grid DataContext="{Binding}" Height="625" Width="978">
        <Grid.RowDefinitions>
            <RowDefinition Height="100" />
            <RowDefinition Height="150*" />
            <RowDefinition Height="200*" />
            <RowDefinition Height="50*" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="100*"></ColumnDefinition>
            <ColumnDefinition Width="100*"></ColumnDefinition>
        </Grid.ColumnDefinitions>
        <StackPanel Grid.ColumnSpan="2" Orientation="Vertical" Margin="0,0,3,65">
            <WrapPanel Width="968" Height="38">
                <Label Content="输入厂编号（例如：D-3203）"    Width="230" Margin="10,0,0,0"  HorizontalAlignment="Left"   FontSize="18" VerticalAlignment="Center" Foreground="#FF141111" />
                <TextBox Name="txtARTICLE" Width="157" Margin="10,0,0,0"  HorizontalAlignment="Left" Panel.ZIndex="1"
                         KeyUp="txtART_KeyUp" Focusable="True" CharacterCasing="Upper" Background="Beige" MaxLength="20" FontSize="18" Foreground="#FF141111" Height="33" />
                <Button Content="查询数据" Height="33" Margin="10,0,0,0"  Name="btnQuery" Width="77" Panel.ZIndex="2"
                        Click="btnQuery_Click"/>
                <Button Content="经纱流转卡" Height="33" Margin="10,0,0,0"  Name="btnWARP" Width="77" Panel.ZIndex="3"
                        Click="btnWARP_Click"/>
                <Button Content="纬纱流转卡" Height="33" Margin="10,0,0,0"  Name="btnWEFT" Width="89" Panel.ZIndex="3"
                        Click="btnWEFT_Click"/>
            </WrapPanel>
        </StackPanel>
        <StackPanel Margin="0,35,3,12" Grid.RowSpan="4" Grid.ColumnSpan="2">            
            <WrapPanel Width="972" Height="128">
                <DataGrid CanUserReorderColumns="True" 
                          CanUserResizeRows="True" CanUserSortColumns="True"
                          AutoGenerateColumns="False"   
                  EnableRowVirtualization="True"  
                  Width="969"
                  Height="114"
                  EnableColumnVirtualization="True"  
                  ScrollViewer.HorizontalScrollBarVisibility="Auto"
                  ScrollViewer.VerticalScrollBarVisibility="Auto"
                  SelectionChanged="MasterDg_SelectionChanged"
                  RowDetailsVisibilityMode="VisibleWhenSelected" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
                                IsSynchronizedWithCurrentItem="True" Opacity="10" Visibility="Visible"
                               ItemsSource="{Binding}" x:Name="MasterDg" 
                               Grid.ColumnSpan="2" Margin="0,10,0,0" Grid.RowSpan="3" Grid.Row="1" DataContext="{Binding}">
                    <!--VKPAUFKRS,VKPAUFLFD,VKPAUFPOS,TO_NUMBER(VKPKUNDNR) AS CUSTOMER,
                    VKPART,VKPFARBE,VKPKDARTNR,VKPMENGE1*0.01 AS QTY,VKPMEEH--> 
                    <DataGrid.Columns>
                        <DataGridTextColumn Binding="{Binding Path=VKPAUFKRS}" Header="前缀" Width="SizeToCells" MinWidth="30" />
                        <DataGridTextColumn Binding="{Binding Path=VKPAUFLFD}" Header="单号" Width="SizeToCells" MinWidth="50" />
                        <DataGridTextColumn Binding="{Binding Path=VKPAUFPOS}" Header="单行" Width="SizeToCells" MinWidth="40" />
                        <DataGridTextColumn Binding="{Binding Path=CUSTOMER}" Header="客户号" Width="SizeToCells" MinWidth="40" />
                        <DataGridTextColumn Binding="{Binding Path=ARTICLE}" Header="小花号" Width="SizeToCells" MinWidth="40" />
                        <DataGridTextColumn Binding="{Binding Path=VKPKDARTNR}" Header="客户花号" Width="SizeToCells" MinWidth="40" />
                        <DataGridTextColumn Binding="{Binding Path=QTY}" Header="订单量" Width="SizeToCells" MinWidth="40" />
                        <DataGridTextColumn Binding="{Binding Path=VKPMEEH}" Header="单位" Width="SizeToCells" MinWidth="40" />
                    </DataGrid.Columns>
                </DataGrid>
            </WrapPanel>
          <WrapPanel Height="515">
                <fd:FilteringDataGrid
                                CanUserReorderColumns="True"  
                                CanUserResizeRows="True" 
                                CanUserSortColumns="True"
                                IsFilteringCaseSensitive="False"
                                AutoGenerateColumns="False"  
                                EnableRowVirtualization="True"  
                                RowDetailsVisibilityMode="VisibleWhenSelected"
                                HorizontalAlignment="Stretch" 
                                VerticalAlignment="Stretch"
                                IsSynchronizedWithCurrentItem="True" 
                                Opacity="10" 
                                Visibility="Visible"
                                ItemsSource="{Binding}" 
                                Margin="0,2,0,0" 
                                x:Name="dlgWARPYARN" Height="507" Width="450">
                    <DataGrid.Columns>
                        <!--ARTICLE,A.BAGGART,A.BAGGFARBE,A.BAGBEM,C.WAFGRPBEZ, REQ,COUNTS-->
                        <DataGridTextColumn Binding="{Binding Path=ARTICLE}" Header="小花号" Width="SizeToCells" MinWidth="30" />
                        <DataGridTextColumn Binding="{Binding Path=BAGGART}" Header="经纱" Width="SizeToCells" MinWidth="30" />
                        <DataGridTextColumn Binding="{Binding Path=BAGGFARBE}" Header="色号" Width="SizeToCells" MinWidth="60" />
                        <DataGridTextColumn Binding="{Binding Path=BAGBEM}" Header="颜色" Width="SizeToCells" MinWidth="40" />
                        <DataGridTextColumn Binding="{Binding Path=WAFGRPBEZ}" Header="轴长"   FontSize="12" Width="SizeToCells" MinWidth="30"/>
                        <DataGridTextColumn Binding="{Binding Path=REQ1}" Header="需求量" Width="SizeToCells" FontSize="12"  MinWidth="60" />
                        <DataGridTextColumn Binding="{Binding Path=COUNTS}" Header="纱支"   FontSize="12" Width="SizeToCells" MinWidth="40"/>
                        <DataGridTextColumn Binding="{Binding Path=REMARK}" Header="筒子信息"   FontSize="12" Width="SizeToCells" MaxWidth="200"/>
                    </DataGrid.Columns>
                    </fd:FilteringDataGrid  >
                    <fd:FilteringDataGrid
                                CanUserReorderColumns="True"  
                                CanUserResizeRows="True" 
                                CanUserSortColumns="True"
                                IsFilteringCaseSensitive="False"
                                AutoGenerateColumns="False"  
                                EnableRowVirtualization="True"  
                                RowDetailsVisibilityMode="VisibleWhenSelected"
                                HorizontalAlignment="Stretch" 
                                VerticalAlignment="Stretch"
                                IsSynchronizedWithCurrentItem="True" 
                                Opacity="10" 
                                Visibility="Visible"
                                ItemsSource="{Binding}" 
                                Margin="10,5,0,0" 
                                x:Name="dlgWEFTYARN" Height="510" Width="395">
                        <DataGrid.Columns>
                        <!--ARTICLE,A.WAGGART,A.WAGGFARBE,A.WAGBEM,WAFMUDESS, REQ,COUNTS-->
                        <DataGridTextColumn Binding="{Binding Path=ARTICLE}" Header="小花号" Width="SizeToCells" MinWidth="30" />
                        <DataGridTextColumn Binding="{Binding Path=WAGGART}" Header="纬纱" Width="SizeToCells" MinWidth="40" />
                        <DataGridTextColumn Binding="{Binding Path=WAGGFARBE}" Header="色号" Width="SizeToCells" MinWidth="40" />
                        <DataGridTextColumn Binding="{Binding Path=WAGBEM}" Header="颜色" Width="SizeToCells" MinWidth="40" />
                        <DataGridTextColumn Binding="{Binding Path=WAFMUDESS}" Header="坯布长" Width="SizeToCells" MinWidth="40" />
                        <DataGridTextColumn Binding="{Binding Path=REQ}" Header="需求量" Width="SizeToCells" MinWidth="40" />
                        <DataGridTextColumn Binding="{Binding Path=COUNTS}" Header="纱支" Width="SizeToCells" MinWidth="40" />
                        </DataGrid.Columns>
                    </fd:FilteringDataGrid  >

            </WrapPanel>
        </StackPanel>
       
    </Grid>
</local:DocumentBase>
